/*
Copyright 2010 Sieric
http://sieric.ca

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package savior.fs;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

public interface FileSystem {

    public boolean createDirectory(String _path) throws FSShouldRetryException;

    public boolean deleteDirectory(String _path) throws FSShouldRetryException;

    public boolean deleteFile(String _path) throws FSShouldRetryException;

    public boolean directoryExists(String _path) throws FSShouldRetryException;

    public InputStream getFile(String _path, long _offset) throws FSShouldRetryException;

    public List<String> listDirectories(String _path) throws FSShouldRetryException; // Each name ends with the delimiter

    public List<FileDescription> listFiles(String _path) throws FSShouldRetryException;

    public OutputStream putFile(String _path, boolean _append) throws FSShouldRetryException; // Return null if there is an error

    public boolean setFileTime(String _path, long _time) throws FSShouldRetryException, FSNotSupportedOperationException;

    public boolean testConnection();
}
